#pragma once

#include "IObject.h"
#include "Camera.h"
#include "PhysicWorld.h"
#include "ParticleSystem.h"
#include <list>

using namespace std;

class IWorld
{
public:
	IWorld(PhysicWorld* phyWorld);
	~IWorld(void);
	virtual void Initialization(void);
	virtual void Update(DWORD elapsedTime);
	virtual void Draw(DWORD elapsedTime);

	virtual list<IObject*>::iterator GetObjects() {return Objects.begin() ;}
	virtual void SetCamera(Camera* cam) {camera = cam;}
	virtual Camera* GetCamera() {return camera;}
	virtual void AddObject(IObject *obj) { physicWorld->AddObject(obj); Objects.push_back(obj); }
	virtual void RemoveObject(IObject *obj) { physicWorld->RemoveObject(obj); Objects.remove(obj); }
	PhysicWorld*	GetPhysicWorld() {return physicWorld; }
	virtual void AddParticleSystem(ParticleSystem* ps) {particlesSystems.push_back(ps);}
	virtual void RemoveParticleSystem(ParticleSystem* ps) {particlesSystems.remove(ps);}

private:
	Camera					*camera;
	list<IObject*>			Objects;	
	list<ParticleSystem*>	particlesSystems;
	PhysicWorld				*physicWorld;

};
